package com.hxh.test;

import java.util.Objects;

/**
 * @author 兴趣使然黄小黄
 * @version 1.0
 * @date 2023/9/6 19:02
 * 用户线程与守护线程
 */


class User{
    int name;
    int age;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof User)) return false;
        User user = (User) o;
        return name == user.name && age == user.age;
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, age);
    }
}
public class Demo01 {

    public static void main(String[] args) {
        User user = new User();
        User user1 = new User();
        user.equals(user1);
        Thread thread = new Thread(() -> {
            System.out.println(Thread.currentThread().getName() + " : " + Thread.currentThread().isDaemon());
            while (true) {

            }
        });
        thread.setDaemon(true);
        thread.start();
        System.out.println("main ok");
    }
}
